package com.zhongc.advance.service.impl;

import com.zhongc.advance.dao.UserSecurityDao;
import com.zhongc.advance.info.UserSecurity;
import com.zhongc.advance.service.AdvanceUserSecurityService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Description
 * @Version 1.0
 * @Author zhongc
 * @Email zhong_ch@foxmail.com
 * @History <li>Author: zhongc</li>
 * <li>Date: 2015-07-27</li>
 * <li>Version: 1.0</li>
 * <li>Content: create</li>
 */
@Repository
public class AdvanceUserSecurityServiceImpl implements AdvanceUserSecurityService {

    private final Logger logger = LoggerFactory.getLogger(getClass());

    @Autowired
    private UserSecurityDao userSecurityDao;

    @Override
    @Transactional
    public int addUserSecurity(List<UserSecurity> order) {
        logger.info("添加用户安全密保入参 ->{}",order);
        return userSecurityDao.addSecurities(order);
    }

    @Override
    @Transactional
    public int updateUserSecutity(List<UserSecurity> order) {
        logger.info("添加修改用户安全密保入参 ->{}",order);
        return userSecurityDao.updateSecurity(order);
    }

    @Override
    public List<UserSecurity> findUserSecutitys(String userId) {
        logger.info("添加修改用户安全密保入参 userId ->{}",userId);
        return userSecurityDao.selectSecuritiesByUserId(userId);
    }
}
